


HTML Code for the Data Grid
<div style="height: 100%; width: 100%; position: absolute; -moz-user-select: none;" id="ctlPageControl_grdDealTypes" class="SG_AG_DataGrid Editable">
														<span style="height: 0px; width: 0px; display: block; position: relative; left: 3px; top: 3px; z-index: -1000;" tabindex="0" id="ctlPageControl_grdDealTypes_FocusHolder"></span><div style="visibility: visible;" class="SG_AG_DataGrid_Header" id="ctlPageControl_grdDealTypes_Header">
															<span class="SG_AG_DataGrid_Row" id="ctlPageControl_grdDealTypes_HeaderRow"><span _key="SequenceNumber" class="SG_AG_DataGrid_HeaderCell DGC_1">Sequence</span><span _key="ModuleCode" class="SG_AG_DataGrid_HeaderCell DGC_2">Module</span><span _key="InstrumentCode" class="SG_AG_DataGrid_HeaderCell DGC_3">Instrument</span><span _key="DealTypeCode" class="SG_AG_DataGrid_HeaderCell DGC_4">Deal Type</span></span>
														</div><div style="visibility: visible;" class="SG_AG_DataGrid_Body" id="ctlPageControl_grdDealTypes_Body">
															<span class="SG_AG_DataGrid_RowsHolder" id="ctlPageControl_grdDealTypes_RowsHolder"><span class="SG_AG_DataGrid_Row SG_AG_DataGrid_Row_Selected" style=""><span class="SG_AG_DataGrid_Cell DGC_1">1</span><span class="SG_AG_DataGrid_Cell DGC_2     SG_AG_DataGrid_Cell_Selected Valid">DEBT</span><span class="SG_AG_DataGrid_Cell DGC_3  Valid">TERM</span><span class="SG_AG_DataGrid_Cell DGC_4  Valid">LT DEBT</span></span><span class="SG_AG_DataGrid_Row" style=""><span class="SG_AG_DataGrid_Cell DGC_1">2</span><span class="SG_AG_DataGrid_Cell DGC_2  Valid">FX</span><span class="SG_AG_DataGrid_Cell DGC_3  Valid">FWD</span><span class="SG_AG_DataGrid_Cell DGC_4  Valid">FX-FORWARD</span></span></span>
														</div><span style="display: none;" id="ctlPageControl_grdDealTypes_TemplateRow"><span class="SG_AG_DataGrid_Row"><span class="SG_AG_DataGrid_Cell DGC_1">&nbsp;</span><span class="SG_AG_DataGrid_Cell DGC_2">&nbsp;</span><span class="SG_AG_DataGrid_Cell DGC_3">&nbsp;</span><span class="SG_AG_DataGrid_Cell DGC_4">&nbsp;</span></span></span><div style="display: none;" class="SG_AG_DataGrid_NonSelectableCover" id="ctlPageControl_grdDealTypes_NonSelectableCover">

														</div>
													</div>



Test Script Code:

DataGrid.cs
public void SetCellValue(string columnTitle, string value)
        {
            // Validate a row is selected
            ValidateRowSelected();

            // 12-Aug-2011 Invoke the DOM Change event
            //Added the OnFocus and OnKeyPress events to resolve the issue with XE datagrid AJAX issue.
            // Without this code, I cant set the value to the cell
            element.OwnerBrowser.Actions.InvokeEvent(element, ScriptEventType.OnKeyPress);


            SetCellValueWithoutRowValidation(columnTitle, value);
        } 

private string GetCellValueWithoutRowValidation(string columnTitle)
{
            // Validate column title by retrieving its key
            GetColumnKey(columnTitle);

            string js = Helper.GetControlTesterJavaScript(element.IdAttributeValue, "getSelectedRow").TrimEnd(';');
            js += String.Format(".getCellDisplayValueByTitle('{0}');", columnTitle);

            return Helper.InvokeScript<string>(element, js);
}

Helper.cs
/// <summary>
        /// Get the Control Tester JavaScript with Method name and Parameters appended, ready for invocation.
        /// </summary>
        /// <param name="elementId">The Id of the element that has an associated ".control" property in the DOM</param>
        /// <param name="methodName">Name of the method to be executed against the Control Tester API</param>
        /// <param name="parameters">Any parameters required by the method</param>
        /// <returns>Control Tester JavaScript</returns>
        public static string GetControlTesterJavaScript(string elementId, string methodName, params object[] parameters)
        {
            if (String.IsNullOrEmpty(elementId))
                throw new ArgumentNullException("Element must have an Id for this method to work.");

            if (String.IsNullOrEmpty(methodName))
                throw new ArgumentNullException("Method Name missing.");

            string tester = String.Format(GetControlTester, elementId, methodName);
            if (parameters != null && parameters.Length > 0)
            {
                string parametersString = String.Empty;
                foreach (object parameter in parameters)
                {
                    if (!String.IsNullOrEmpty(parametersString))
                        parametersString += ",";

                    if (parameter is String)
                        parametersString += String.Format("'{0}'", parameter as string);
                    else if (parameter is Int32 || parameter is Decimal || parameter is bool)
                        parametersString += parameter.ToString().ToLower();
                    else if (parameter is DateTime)
                        parametersString += String.Format("'{0}'", Convert.ToDateTime(parameter).ToShortDateString());
                }

                tester += String.Format("({0});", parametersString);
            }
            else
                tester = tester + "();";

            return tester;
        }

public static void InvokeScript(Element element, string script)
        {
         
            element.OwnerBrowser.Actions.InvokeScript(script);
        
        }   
